<template>
  <div>
    <div>
      <el-descriptions :title="tablerow.id + '号用户信息'">
        <el-descriptions-item label="日期">{{ tablerow.date }}</el-descriptions-item>
        <el-descriptions-item label="姓名">{{ tablerow.name }}</el-descriptions-item>
        <el-descriptions-item label="省份">{{ tablerow.province }}</el-descriptions-item>
        <el-descriptions-item label="市区">{{ tablerow.city }}</el-descriptions-item>
        <el-descriptions-item label="邮编">{{ tablerow.zip }}</el-descriptions-item>
        <el-descriptions-item label="地址">{{ tablerow.address }}</el-descriptions-item>
      </el-descriptions>
    </div>
    <div slot="footer" class="dialog-footer">
      <!-- $emit使用自定义事件 -->
      <el-button type="primary" @click="$emit('onCancel')">确 定</el-button>
      <el-button @click="$emit('onCancel')">取 消</el-button>
    </div>
  </div>
</template>

<script>
export default {
  // 接受父组件传过来的值
  props: ['tablerow'],
  mounted() {
    console.log(this.tablerow);
  },
};
</script>

<style>
.dialog-footer {
  text-align: center;
}
</style>
